﻿using System;
using System.Windows.Input;

namespace PersonaLibrary
{
	public class CommandBase : ICommand
	{
		#region Constructors

		public CommandBase()
		{
		}

		#endregion

		#region ICommand Members

		public virtual bool CanExecute(object parameter)
		{
			return false;
		}

		public event EventHandler CanExecuteChanged
		{
			add { CommandManager.RequerySuggested += value; }
			remove { CommandManager.RequerySuggested -= value; }
		}

		public virtual void Execute(object parameter)
		{

			if (CommandExecuted != null)
				CommandExecuted(this, EventArgs.Empty);
		}

		internal static event EventHandler CommandExecuted;

		#endregion
	}
}
